<script>
    dojo.require("dojox.form.Uploader");
    dojo.require("dojox.form.uploader.FileList");
    dojo.require("dijit.layout.TabContainer");
    dojo.require("dijit.layout.ContentPane");
    dojo.addOnLoad(function(){
        var uploadBtn = dijit.byId("upload");
        dojo.connect(uploadBtn,"onClick",function(){
            dojo.byId("abcdef").value = dijit.byId("vi_product_description").attr("value");
            dojo.byId("ghijkl").value = dijit.byId("fr_product_description").attr("value");
            dojo.byId("mnopq").value = dijit.byId("dedault_category").value;

        });
    });
</script>
<?php 
    $default_category = isset($default_category)?$default_category:2;
?>
<script type="text/javascript">
    dojo.addOnLoad(function() {
        var idParentStore = new dojo.data.ItemFileReadStore({
            url:"<?php echo base_url() ?>admin/product/json_product_categories"
        });
        var catParentSelect = new dijit.form.FilteringSelect({
            id:"dedault_category",
            name:"dedault_category",
            value:"<?php echo $default_category ?>",
            store:idParentStore,
            searchAttr: "name"
        },"dedault_category");
    });
    
</script>
<p>
    <a href="<?php echo current_url() ?>?html5">HTML5</a>
    <a href="<?php echo current_url() ?>?flash">Flash</a>
</p>
<form method="post" action="<?php echo site_url(); ?>/admin/product/add_product" id="add_product_form" enctype="multipart/form-data" >
    <table  width="100%" cellspacing="10">
        <tr>
            <td style="width: 20%">Tên sản phẩm tiếng Việt:</td>
            <td><input id="vi_name" name="vi_name" value="" required="true" style="width: 250px;" dojoType="dijit.form.ValidationTextBox" /></td>
        </tr>
        <tr>
            <td style="width: 20%">Tên sản phẩm tiếng Pháp:</td>
            <td><input id="fr_name" name="fr_name" value="" required="true" style="width: 250px;" dojoType="dijit.form.ValidationTextBox" /></td>
        </tr>
        <tr>
            <td>Image:</td>
            <td>
                <input class="browseButton" name="uploadedfile" multiple="true" type="file" dojoType="dojox.form.Uploader" label="Select Some Files" id="uploader" />
            </td>
        </tr>
        <tr>
            <td></td>
            <td><div id="files" dojoType="dojox.form.uploader.FileList" uploaderId="uploader"></div></td>
        </tr>
        <tr>
            <td>Danh mục mặc định:</td>
            <td>
                <input type="hidden" id="mnopq" name="dedault_category" />
                <input id="dedault_category" />
            </td>
        </tr>
        <tr>
            <td style="width: 20%">Số lượng sản phẩm:</td>
            <td><input id="quantity" name="quantity" value="" required="true" style="width: 250px;" dojoType="dijit.form.NumberTextBox" /></td>
        </tr>
        <tr>
            <td style="width: 20%">Giá sản phẩm:</td>
            <td><input id="price" name="price" value="" required="true" style="width: 250px;" dojoType="dijit.form.NumberTextBox" /></td>
        </tr>
        <tr>
            <td style="width: 20%">Trọng lượng sản phẩm:</td>
            <td><input id="weight" name="weight" value="" style="width: 250px;" dojoType="dijit.form.NumberTextBox" /></td>
        </tr>
        <tr>
            <td>Mô tả sản phẩm tiếng Việt:</td>
            <td>
                <input type="hidden" id="abcdef" name="vi_product_description" value="aaaa" />
                <div style="width: 400px;">
                    <div data-dojo-type="dijit.Editor" id="vi_product_description" data-dojo-props='height:"4",value:"",extraPlugins:["tabIndent"]'>

                    </div>  
                </div>
            </td>
        </tr>    
        <tr>
            <td>Mô tả sản phẩm tiếng Pháp:</td>
            <td>
                <input type="hidden" id="ghijkl" name="fr_product_description" value="aaaa" />
                <div style="width: 400px;">
                    <div data-dojo-type="dijit.Editor" id="fr_product_description" data-dojo-props='height:"4",value:"",extraPlugins:["tabIndent"]'>

                    </div>  
                </div>
            </td>
        </tr>    
    </table>
    <div style="clear: both;"><input type="submit" name="upload" id="upload" label="Submit" dojoType="dijit.form.Button" /></div>
</form>